package com.ysd.gulimall.order;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.retry.annotation.EnableRetry;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
@EnableRetry
@EnableDiscoveryClient
@SpringBootApplication
@EnableFeignClients
public class GulimallOrderApplication implements DisposableBean{
    private static ConfigurableApplicationContext ctx;
    public static void main(String[] args) {
        SpringApplication.run(GulimallOrderApplication.class, args);
    }
    @Override
    public void destroy() throws Exception {
        if (null != ctx && ctx.isRunning()) {
            ctx.close();
        }
    }
}
